back to index

HTML Input Attribute

The input value attribute

The value attribute specifies an initial value for an input field:






The input readonly attribute

The readonly attribute specifies that an input field should be read-only (cannot be changed):






The input disabled attribute

The disabled attribute specifies that an input field should be disabled (unusable and un-clickable):






The input size attribute

The size attribute specifies the width (in characters) of an input field:






The input maxlength attribute

The maxlength attribute specifies the maximum number of characters allowed in an input field:






The input min and max attributes

The min and max attributes specify the minimum and maximum values for an input element.







The input multiple attributes

The multiple attribute specifies that the user is allowed to enter more than one value in an input field.



To select multiple files, hold down the CTRL or SHIFT key while selecting.

The input pattern attribute

The pattern attribute specifies a regular expression that the input element's value is checked against.



The input placeholder attribute

The placeholder attribute specifies a short hint that describes the expected value of an input field.



The input required attribute

The required attribute specifies that an input field must be filled out before submitting the form.

The input step attribute

The step attribute specifies the legal number intervals for an input element.

The input autofocus attribute

The autofocus attribute specifies that the input field should automatically get focus when the page loads.






The input height and width attributes

The height and width attributes specify the height and width of an input type="image" element.





Note: The input type="image" sends the X and Y coordinates of the click that activated the image button.

The input list attribute

The list attribute refers to a datalist element that contains pre-defined options for an input element.

The autocomplete attribute

The autocomplete attribute specifies whether or not an input field should have autocomplete enabled.

Fill in and submit the form, then reload the page to see how autocomplete works.

Notice that autocomplete is "on" for the form, but "off" for the e-mail field!